/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ps.server.classes;

/**
 *
 * @author Ricardo
 */
public class suppliers {

    private String id;
    private String link_rewrite;
    private String name;
    private String[][] meta_title;
    private String[][] meta_description;
    private String[][] meta_keywords;
    private String[][] description;
    private int column = 7;

    public String[][] getDescription() {
        return description;
    }

    public void setDescription(String[][] description) {
        this.description = description;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLink_rewrite() {
        return link_rewrite;
    }

    public void setLink_rewrite(String link_rewrite) {
        this.link_rewrite = link_rewrite;
    }

    public String[][] getMeta_description() {
        return meta_description;
    }

    public void setMeta_description(String[][] meta_description) {
        this.meta_description = meta_description;
    }

    public String[][] getMeta_keywords() {
        return meta_keywords;
    }

    public void setMeta_keywords(String[][] meta_keywords) {
        this.meta_keywords = meta_keywords;
    }

    public String[][] getMeta_title() {
        return meta_title;
    }

    public void setMeta_title(String[][] meta_title) {
        this.meta_title = meta_title;
    }

    public String toXML() {
        String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
        xml += "<prestashop xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n";
        xml += "<supplier>\n";
        xml += "<id>" + this.getId() + "</id>\n";
        xml += "<link_rewrite>" + this.getLink_rewrite() + "</link_rewrite>\n";
        xml += "<name>" + this.getName() + "</name>\n";
        xml += "<meta_title>\n";
        for (int x = 0; meta_title.length > x; x++) {
            xml += "<language id=\"" + meta_title[x][0] + " \">" + meta_title[x][1] + "</language>\n";
        }
        //<language id="3"></language>
        //<language id="5"></language>
        xml += "</meta_title>\n";
        xml += "<meta_description>\n";
        for (int x = 0; meta_description.length > x; x++) {
            xml += "<language id=\"" + meta_description[x][0] + " \">" + meta_description[x][1] + "</language>\n";
        }
        //<language id="3"></language>
        //<language id="5"></language>
        xml += "</meta_description>\n";
        xml += "<meta_keywords>\n";
        for (int x = 0; meta_keywords.length > x; x++) {
            xml += "<language id=\"" + meta_keywords[x][0] + " \">" + meta_keywords[x][1] + "</language>\n";
        }
        //<language id="3"></language>
        //<language id="5"></language>
        xml += "</meta_keywords>\n";
        xml += "<description>\n";
        for (int x = 0; description.length > x; x++) {
            xml += "<language id=\"" + description[x][0] + " \">" + description[x][1] + "</language>\n";
        }
        //<language id="3"></language>
        //<language id="5"></language>
        xml += "</description>\n";
        xml += "</supplier>\n";
        xml += "</prestashop>\n";
        return xml;
    }

    public int getColumn() {
        return column;
    }

    public String[] GetMetaData() {
        return new String[]{"id", "link_rewrite", "name", "meta_title", "meta_description", "meta_keywords", "description"};
    }
}
